package org.kent.w.base.common.validate.constraints;

import org.kent.w.base.common.enums.StringEnum;
import org.kent.w.base.common.validate.validator.StringEnumValueConstraintValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Int Enum Value
 *
 * @author wujigang
 * @date 2019/9/17
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = StringEnumValueConstraintValidator.class)
public @interface StringEnumValue {

    String message() default "{custom.message.enum.value}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    Class<? extends StringEnum> enumClass();

}
